<template>
  <div id="app">
        尚1
    <Header v-show="isShow"/>
    <router-view></router-view>
    <Footer></Footer>
  </div>
</template>

<script>
import Header from './components/header/index'
import home from './pages/home/index'
import  Footer from './components/footer/index'
export default {
  name: "App",
  components: {
    home,
    Header,
    Footer
  },
  mounted() {
    console.log(this.$router.options.routes)
    console.log("我是根组件")
    this.$store.dispatch('categoryList')//放在根组件里面,只会渲染一次,且不会因为刷新而丢失数据
  },
  methods: {},
  computed:{
    isShow(){
      if(this.$route.path!='/home'){
        return true
      }else {
        return false
      }
    }
  }
};
</script>

<style scoped lang="less">
</style>
